package com.cms.service.impl;


import com.cms.dao.ProjectMapper;
import com.cms.entity.Project;
import com.cms.exception.DuplicateKeyException;
import com.cms.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class ProjectServiceImpl implements ProjectService {
    @Autowired
    private ProjectMapper projectMapper;

    @Override
    public List<Project> findAll() {
        return projectMapper.findAll();
    }

    @Override
    public int insertProject(Project project) throws DuplicateKeyException {
        return projectMapper.insertProject(project);
    }

    @Override
    public int updateProject(HashMap<String, String> updateMap) throws DuplicateKeyException {
        return projectMapper.updateProject(updateMap);
    }

    @Override
    public int deleteProject(String id) {
        return projectMapper.deleteProject(id);
    }
}
